<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
  </head>
  <body>
    <script type="text/javascript">
      // 补全代码
      Array.prototype._map = function (fn) {
        if (typeof fn !== 'function') return
        let result = []
        for (let i = 0; i < this.length; i++) {
          result.push(fn(this[i]))
        }
        return result
      }
      console.log([1, 2]._map((i) => i * 2))
    </script>
  </body>
</html>
